#include "ring_thread_list.h"
#include <stdio.h>
void main()
{
	struct list* start=NULL;
	struct list *gg;
	//clrscr();
	//create(gg,"hi\n");
	struct thread* tab[10];
	int i;
	for(i=0;i<10;i++){
		tab[i]=(struct list*)malloc(sizeof(struct thread));
		tab[i]->thread_id=i*10;
		tab[i]->context.uc_stack.ss_sp=NULL;
		tab[i]->execution_time=NULL;
	}
	printf("Now display the value of the circular lists:-\n");
	display(start);
	/*start=insert(start,"high every body\n");
start=insert(start,"hi sorry I made a typo\n");
start=insert(start,"it's me again just checking\n");
start=insert(start,"the message was too long\n");
start=insert(start,"so I had to break it to little\n");
start=insert(start," pieces\nLike I was saying\n");
start=insert(start,"I was just checking to see\n");
start=insert(start,"if we still are cool\n");
start=insert(start,"and all, you know about the typo\n");
start=insert(start,"cause you gotta know I didn't\n");
start=insert(start," do it on purpose. But I'm not\n");
start=insert(start,"stupid but I do make mistakes\n");
start=insert(start,"like everybody else so again\n");
start=insert(start,"HI EVERYBODY\n");*/
	for(i=0;i<10;i++){
		start=insert(start,tab[i]);
		if(NULL!=start&&in(start,tab[i]))
			fprintf(stderr,"current size: %d and rising\n",size(start));
	}

	printf("\nAfter insertion, the list is\n");
	display(start);
	for(i=0;i<10;i++){
		start=shift(start);
		start=remove_element(start,tab[i]);
		printf("\nAfter shift, the list is\n");
		display(start);

	}
	start=free_list(start);
	display(start);
	//getch();
}
